package
{
	import flash.display.Sprite;
	import flash.text.AntiAliasType;
	import flash.text.Font;
	import flash.text.StyleSheet;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;

	
	public class TestTextField2 extends Sprite
	{
		[Embed(source="./assets/yegenyouxingshu.ttf", embedAsCFF="false", fontName="fangzheng", mimeType="application/x-font-truetype")]
		static	public	var myFont:Class;
		
		public function TestTextField2()
		{
			super();
			
			Font.registerFont(TestTextField2.myFont);

			
			var text:TextField = new TextField();
			text.border = true;
			text.wordWrap = true;
			text.autoSize = TextFieldAutoSize.LEFT;
			
			this.addChild(text);
			
			var format:TextFormat = new TextFormat();
			format.color = 0xff0000;
			
			text.htmlText = "<p>大唐帝国</p>";
			
			//text.rotation = 30;
			format.size = 64;
			text.embedFonts = true;
			format.font = "fangzheng";
			text.setTextFormat(format);
			text.type = TextFieldType.INPUT;
			//text.antiAliasType = AntiAliasType.ADVANCED;
			//var css:StyleSheet = new StyleSheet();
			//css.setStyle("p", {color:"#ff0000",fontFamily:"fangzheng"});
			//text.styleSheet = css;
			text.replaceText(0,2,"大明");
			
//			trace(TextField.fontList);
			
		}
	}
}